<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('AdminIndex/staff')}">员工列表</a></li>
			<li><a href="{:url('AdminIndex/addStaff')}">新增员工</a></li>
		</ul>
		<table class="table table-hover table-bordered  margin-top-20">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>{:lang('USERNAME')}</th>
					<th>类型</th>

					<th>性别</th>
					<th>工龄</th>
					<th>电话</th>
					<th>头像</th>
					<th>职称</th>
                    <th>证书</th>
                    <th>创建时间</th>
					<th>状态</th>
					<th width="140">{:lang('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="users" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.name}</td>
                    <td>{$vo.category_name}</td>
					
					<td>{$vo.sex}</td>
					<td>{$vo.social_work_age}</td>
					<td>{$vo.tel}</td>
					<td>
						<img style="width: 60px;height:60px;" src="{:cmf_get_image_preview_url($vo.avatar)}"/>
					</td>
					<td>{$vo.professional_title}</td>
					<td>
						<if condition="!empty($vo['professional_certificates'])">
							<link rel="stylesheet" href="__STATIC__/css/viewer.min.css">
							<script src="__STATIC__/js/viewer.min.js"></script>
							<style type="text/css">
								.imglist img{
									width:60px;
									height: 60px;
									float: left;
								}
								.imglist ul{
									max-width: 300px;
								}
							</style>
							<ul id="shop_images" class="imglist">
								<foreach name=":explode(',',$vo['professional_certificates'])" item="vi">
									<li><img data-original="{:cmf_get_image_url($vi)}" src="{:cmf_get_image_url($vi)}" ></li>
								</foreach>
							</ul>
							<script>var viewer = new Viewer(document.getElementById('shop_images'),{url:'data-original'});
							</script>
							<hr>
						</if>
					</td>
					<td>{:date('Y-m-d',$vo.create_time)}</td>
                    
					
					<td>
						<switch name="vo.status">
							<case value="1">
								<span class="label label-success">正常</span>
                            </case>
                            <case value="0">
								<span class="label label-danger">无效</span>
							</case>
                        </switch>
					</td>
					
					<td>
                        
							<a class="btn btn-xs btn-primary" href='{:url("AdminIndex/editStaff",array("id"=>$vo["id"]))}'>修改</a>
							<a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('AdminIndex/deleteStaff',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
						</if>
					</td>
				</tr>
				</foreach>
			</tbody>
        </table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>